Cred to rendering and base code from codeInComplete.com