Added width parameter (and fixed bug)