fixed most of the clientside rendering code