Delete unused part of code. Fix relative bugs.