Adding conditions for first and last amazer