Changed tabs to spaces and converted into two separate functions