Terrible coding practice but copy and pasted code due to time constraints