fix and rewrite energy rendering code