Code commented.
Added orientation support.