pretty good, but could be cleaner :)