added fillText; bit of restructuring and bug fixing