Cleaned up code. Fixed apply_surface call in main for message.