tidying stuff up
refactored rect rendering