Impelements shadows, fixes bugs, and optimizes