finish most stupid code. need refactoring I think