bug fixes and finalized makefiles