some more structure, added jade
some functionality using luma histogram