fixed some stuff and added a previous button