fix bugs and remove unnecessery files