Added test, cleaned up a little