implements js normalize height function