implemented all logic for both activities, supported landscape mode