John, I'm sorry your dive probably wasn't as enjoyable as you hoped for (although it sounds like you still did enjoy it due to the shark), but you have an excellent attitude as far as your mistakes go by being able to objectively analyze what went wrong, what you could have done better, and sharing it with us. Plenty of good advice has already been given on this thread, so I can't offer much, but I would like to point out that while you may not have enjoyed this dive that much, you learned a great deal from it and for that reason it's probably good that you had the experiences that you did.
We don't learn from the dives that went great; we learn from the dives that went wrong.
Yep, what he said.
You are doing the right thing by debriefing your dive. Even if you don't discuss it with your dive buddy(it sounds like you didn't Have one- red flag), talking about it with another diver(us even) helps you recognize errors and solve them for the future. Good job. You'll get better and better with time. You are on teh right track.
And EMTTIM, congratulations on your DM.