added function drawscreen and clear command, fixed logic