Edited some redundant code