fix issues 3, 4, 5

closes #4 
#3 
#5