Updated code to be seperate from everything else