refactored code
fixed some errors