use stdlib for clarity; bugfix