Fixed all bugs from part 1. Added variable declaration and usage error messages