Implemented locks - Do not merge. Need review from Pichlik