This is how learning works. Don't beat yourself up about it. Very few people successfully build perfect software products their first time out. A person should start out by aiming for the stars and failing -- that's how you figure out how reality works.