Added text overlay and improved general code