cleaned a bit, now should be fully functional