working, but not neat