cleaned up script. Added more output