Merged code with Vishnus and Danilos stuff