Code for LALOC

All the code for lots and lots of changes