code is cleaned up
added headers