cleaned up code. added status message