fixed main functionality, fixed orientation changing