Many fixes

Fixed issues #17 & #18
Better formatting
Fixed syntax errors