changed some things, added new functions