Implemented longestqueued algorithm, and some further Ec2 integration