added @SuppressWarnings(unchecked) to silent compiler warning