completely rewritten getspec