added support for safari, fixed some indentation