Started bugfixing but need to finish