Orientation and Memory Management

Handled some memory issues that could pop up.  Also took care of orientation problems.