changed alignment and rearranged methods