fixed some little bugs and compiled