cleaned up code/behavior a little