cleaned up code
finished part a