refactor; this is a personal script anyways