fixed some stuff, ready for testing