refactored var statements
fixed cursor rendering