separated out test code and and fixed some spacing issues