Still bad code, works though