add z-index check, move position check into prototype