Revised to follow BEM prinicples