fixed indentation, added tests, fixed make bugs