Added lock functions and some other shit

yehhhh