Added Revision related stuff made by Matej, fixed by me