alternative sizeof method