bunch of changes, add functionality, fix bugs