Formatting code/removing irrelevant algorithm