Fixed looping functions
Added selection of items