Should probably rename all the functions correctly.